%include "asm_io.inc"
segment .data
;
;initialized data is put in the data segment here
;
prompt1 db "Give 1st number:    ", 0
prompt2 db "Give 2nd number:    ", 0
prompt3 db "Give 3rd number:    ", 0
prompt4 db "Give 4th number:    ", 0
prompt5 db "Give 5th number:    ", 0


segment .bss
;
;uninitialized data is put in the bss segment
;
input1 resd 1
input2 resd 2
input3 resd 3
input4 resd 4
input5 resd 5

segment .text
global asm_main
asm_main:
enter 0,0 ;setup routine
pusha

;
;code is put here
;

mov		eax, prompt1
call	print_string
call	read_int
mov		[input1], eax

mov		eax, prompt2
call	print_string
call	read_int
mov		[input2], eax

mov		eax, prompt3
call	print_string
call	read_int
mov		[input3], eax

mov		eax, prompt4
call	print_string
call	read_int
mov		[input4], eax

mov		eax, prompt5
call	print_string
call	read_int
mov		[input5], eax


mov		eax, [input5]
call	print_int
mov		al, ','
call	print_char
mov		eax, [input4]
call	print_int
mov		al, ','
call	print_char
mov		eax, [input3]
call	print_int
mov		al, ','
call	print_char
mov		eax, [input2]
call	print_int
mov		al, ','
call	print_char
mov		eax, [input1]
call	print_int
call	print_nl

popa
mov eax,0 ;return back to C
leave
ret